package com.atguigu.jxc.controller;

import com.atguigu.jxc.domain.ServiceVO;
import com.atguigu.jxc.entity.OverflowList;
import com.atguigu.jxc.service.OverflowListGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;
import java.util.Map;

/**
 * @author fenge
 */
@Controller
@RequestMapping("overflowListGoods")
public class OverflowListGoodsController {

    @Autowired
    private OverflowListGoodsService overflowListGoodsService;

    @PostMapping("save")
    @ResponseBody
    public ServiceVO save(OverflowList overflowList, String overflowListGoodsStr, HttpSession session){
        overflowListGoodsService.save(overflowList,overflowListGoodsStr,session);
        return new ServiceVO(100,"请求成功");
    }

    @PostMapping("list")
    @ResponseBody
    public Map<String,Object> list(String  sTime, String  eTime){
        return overflowListGoodsService.list(sTime,eTime);
    }

    @PostMapping("goodsList")
    @ResponseBody
    public Map<String,Object> goodsList(Integer overflowListId){
        return overflowListGoodsService.goodsList(overflowListId);
    }


}
